﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using TestPlatform.Core;

namespace TestPlatform.Performer.Mssql
{
    public class MssqlDeletePerformer : BaseDeletePerformer
    {
        public override string UnderlyinEngine { get { return "MSSQL"; } }

        public MssqlDeletePerformer()
            : base(new MssqlHelper())
        {

        }

        protected override void RemoveEntity(Guid id)
        {
            using (var c = MssqlHelper.CreateConnection())
            {                
                SqlCommand cmd = c.CreateCommand();
                cmd.CommandText = string.Format("DELETE FROM [Users] WHERE Id = '{0}'", id);
                cmd.ExecuteNonQuery();                
            }
        }
    }
}
